package com.wms.dao;

import com.wms.domain.GoodsDomain;
import com.wms.domain.PickingDomain;
import com.wms.domain.StorehouseDomain;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.mapstruct.Mapper;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

@Mapper
public interface StorehouseMapper {

    public void insertStorehouse(StorehouseDomain storehouseDomain);

    public void updateStorehouse(StorehouseDomain storehouseDomain);

//    @Select("select * from storehouse where g_id = ${g_id}")
//    public StorehouseDomain getStorehouseByG_id(Long g_id);

    @Select("select * from storehouse where g_id = ${g_id} and store_location_id = ${store_location_id}")
    public StorehouseDomain getStorehouseByG_idAndStoreL_id(Long g_id,Long store_location_id);

//    @Delete("UPDATE goods SET goods_stat = 0 WHERE id = ${id}")
//    void deleteGoods(@Param("id") Long id);

    public List<HashMap<String,Object>> getStorehousePage(StorehouseDomain storehouseDomain);


    public List<HashMap<String,Object>> getStorehouseByGid(Long id);

    public void addPicking(PickingDomain pickingDomain);

    @Select("select * from picking where store_detail_id = ${store_detail_id}")
    public List<PickingDomain> getPicking(Long store_detail_id);

    @Delete("delete from picking where store_detail_id = ${store_detail_id}")
    public void deletePicking(Long store_detail_id);
}
